Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the "Dock controls" item in #738: V1 dock dust collection settings and actions.
Changes
DustCollectionModeTraitdust_collection_mode_options: smart, light, balanced, max (the set the Roborock app offers).set_dust_collection_mode(mode)sendsset_dust_collection_modewith{"mode": <code>}. A mode outside the options raisesRoborockUnsupportedFeatureand sends nothing.start_dust_collection()/stop_dust_collection()sendapp_start_collect_dust/app_stop_collect_dust.RoborockDockDustCollectionModeCodegainsstrong = 3, so reading that code no longer falls back tounknown. The app never offers it, so the setter rejects it.DustCollectionFrequencyTrait(PropertiesApi.dust_collection_frequency), the app's auto-empty frequencyget_dust_collection_switch_status;set_frequency(frequency)sendsset_dust_collection_switch_statuswith{"status": <code>}.RoborockDockDustCollectionFrequencyCode: off 0, balanced 1, high 2 (unknown = -1for unexpected firmware codes).dock_features.is_collectable, same as the mode trait.docs/V1_API_COMMANDS.md: entries for both setters andget/set_dust_collection_switch_status.Wire formats
get/set_dust_collection_mode,{"mode": n}get/set_dust_collection_switch_status,{"status": n}auto_dust_collectioninget_status)Codes and option lists come from the Roborock app's V1 device plugin, and were confirmed on a Saros 10R (
roborock.vacuum.a144, dock type 16).Home Assistant
When Home Assistant bumps to this version, the
dust_collection_modeselect should take its options fromdust_collection_mode_optionsinstead ofRoborockDockDustCollectionModeCode.keys(). Otherwise it lists the newstrongmember, which the app does not offer and which has no translation.set_dust_collection_mode()validates against the same list.Testing
uv run pre-commit run --all-files: all hooks pass.uv run pytest: 2350 passed.tests/devices/traits/v1/test_dust_collection_mode.pyandtest_dust_collection_frequency.py: option lists, setter commands, rejection of unoffered values without sending, state unchanged after a failed command, unknown firmware codes, trait availability per dock type.start_dust_collection()the robot state went fromchargingtoemptying_the_bin; afterstop_dust_collection()5 s later it went todockingand then back tocharging.